package io.renren.modules.student.service.impl;

import io.renren.common.utils.PageUtils;
import io.renren.modules.student.dao.StuCourseManageDao;
import io.renren.modules.student.service.StuCourseManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class StuCourseManageServiceImpl implements StuCourseManageService {
   @Autowired
   private StuCourseManageDao stuCourseManageDao;
    @Override
    public PageUtils queryList(Map<String, Object> param) {
        List<Map<String, Object>> list =stuCourseManageDao.queryList(param);
        int total = stuCourseManageDao.queryTotal(param);
        int limit = Integer.parseInt(param.get("limit").toString());
        int page = Integer.parseInt(param.get("page").toString());
        PageUtils result = new PageUtils(list,total,limit,page);
        return result;
    }
   /*
   删除课程
    */
    @Override
    public void deleteCourse(Map<String, Object> param) {
        stuCourseManageDao.deleteCourse(param);
    }
}
